]> dgit.raspbian.org Git - gnome-shell.git/log
gnome-shell.git
6 years agovolume: Skip volume-change feedback while playing
Florian Müllner [Fri, 22 Nov 2019 17:37:25 +0000 (18:37 +0100)]
volume: Skip volume-change feedback while playing

The audio feedback for volume changes is useful when nothing is outputting
sound, but only then. Skip the sound notification in that case.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/53

6 years agogvc: Update submodule
Florian Müllner [Fri, 22 Nov 2019 17:37:25 +0000 (18:37 +0100)]
gvc: Update submodule

gnome-volume-control now has API to expose the stream state, which
we will need in the following commit.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/53

6 years agoslider: Stop emulating drags in key handling
Florian Müllner [Mon, 26 Feb 2018 19:57:10 +0000 (20:57 +0100)]
slider: Stop emulating drags in key handling

Emitting ::drag-end after changing the slider value via arrow keys
was a cheap way to make the sound feedback work for keyboard input.
But now that the volume indicator plays the sound on ::value-changed
as well, we can stop doing that - after all, key presses aren't drags.

Besides that, this will make the limiting of feedback to actual volume
changes from the previous commit work for key events as well.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/53

6 years agovolume: Only emit sound feedback after volume changes
Florian Müllner [Fri, 23 Feb 2018 22:58:22 +0000 (23:58 +0100)]
volume: Only emit sound feedback after volume changes

gnome-settings-daemon doesn't play the volume change sound when
the volume stayed the same (that is, it is already at its maximum
or minimum). This looks like the right thing to do, so copy its
behavior.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/53

6 years agovolume: Add back sound feedback on scroll
Florian Müllner [Fri, 23 Feb 2018 22:58:22 +0000 (23:58 +0100)]
volume: Add back sound feedback on scroll

Commit 8d4855f1008 accidentally removed the volume change feedback
for scroll events. Add it back to be consistent again with moving
the slider via arrow keys, slider drags/clicks and gsd's media keys
handling.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/53

6 years agoappDisplay: Ensure we don't recreate existing AppIcons for folders
Jonas Dreßler [Sat, 23 Nov 2019 20:44:55 +0000 (21:44 +0100)]
appDisplay: Ensure we don't recreate existing AppIcons for folders

This was missed in 910037f014355ee9680c45f82a4aac2891c4074f, make sure
we do the same thing for AppIcons that are created when reloading
folders.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/851

6 years agocleanup: Remove another pair of unneeded parentheses
Florian Müllner [Sat, 16 Nov 2019 16:14:38 +0000 (17:14 +0100)]
cleanup: Remove another pair of unneeded parentheses

Eslint didn't spot this before version 6.5, so this fell through
the cracks.

6 years agodateMenu: Don't ellipsize forecast times and temps
Florian Müllner [Wed, 20 Nov 2019 22:15:55 +0000 (23:15 +0100)]
dateMenu: Don't ellipsize forecast times and temps

While those should be concise enough to fit, they may not where
temperatures drop into double-digit negatives. It seems better
to accept some awkward horizontal scrolling in that case than
shorten relevant information.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1926

6 years agodateMenu: Move weather forecast validity check
Florian Müllner [Fri, 22 Nov 2019 22:27:47 +0000 (23:27 +0100)]
dateMenu: Move weather forecast validity check

Commit b779f6f728 added a check to filter out invalid weather forecasts.

However the check is currently done when creating UI for the forecasts,
which means we end up with fewer forecasts than we could display if any
forecasts are invalid.

We can avoid that issue by checking the validity while collecting the
forecasts, so do that instead.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1927

6 years agodateMenu: Only show forecasts
Florian Müllner [Fri, 22 Nov 2019 21:44:42 +0000 (22:44 +0100)]
dateMenu: Only show forecasts

We currently always start with the current weather info, then append
forecasts. This is slightly confusing, as the only hint that the
first item is special is the past (and potentially "odd") time.

Stop doing that and base all items on forecasts.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1927

6 years agodateMenu: Don't limit weather forecasts to the same day
Florian Müllner [Wed, 20 Nov 2019 22:23:50 +0000 (23:23 +0100)]
dateMenu: Don't limit weather forecasts to the same day

As we get closer to midnight, we show fewer forecasts than we could
fit, or none at all. It makes more sense to continue the forecasts
into the wee hours in that case, so only exclude past forecasts,
but not ones from following days.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1927

6 years agodateMenu: Try harder finding a reasonable weather location name
Florian Müllner [Wed, 20 Nov 2019 21:15:26 +0000 (22:15 +0100)]
dateMenu: Try harder finding a reasonable weather location name

Weather stations can have unwieldy long names, which don't fit the
limited space we have available. City names are usually more suitable,
so use the name of the nearest city instead if possible.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1927

6 years agodateMenu: Add some spacing between weather header and location
Florian Müllner [Wed, 20 Nov 2019 21:21:48 +0000 (22:21 +0100)]
dateMenu: Add some spacing between weather header and location

In case of a very long location name, the label may take up all
available space. Make sure there is at least some spacing between
header and location in that case.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1927

6 years agodateMenu: Bottom-align weather title/location
Florian Müllner [Wed, 20 Nov 2019 20:48:03 +0000 (21:48 +0100)]
dateMenu: Bottom-align weather title/location

The two labels use different font sizes, so they don't align properly.
Unfortunately we don't have BASELINE alignment in Clutter, but at least
END comes closer than the default FILL.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1927

6 years agodateMenu: Re-indent weather section
Florian Müllner [Fri, 22 Nov 2019 14:41:19 +0000 (15:41 +0100)]
dateMenu: Re-indent weather section

Before making code changes, make sure the class confirms to the
new coding style.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1927

6 years agoswitcherPopup: Improve modifier-less keybinding navigation
Florian Müllner [Mon, 11 Nov 2019 21:00:01 +0000 (22:00 +0100)]
switcherPopup: Improve modifier-less keybinding navigation

Commit c899453800f11 lifted the requirement of switcher keybindings
to contain a modifier, however it is currently only possible to
finish it by letting it time out.

Improve that by also accepting space/enter key presses to confirm the
selection immediately.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1883

6 years agoswitcherPopup: Use roundtrip time when the popup is modifier-less
Jonas Dreßler [Fri, 22 Nov 2019 19:56:30 +0000 (20:56 +0100)]
switcherPopup: Use roundtrip time when the popup is modifier-less

The noModsTimeout obviously finishes inside a timeout callback, which
means `global.get_current_time()` might return Clutter.CURRENT_TIME (ie.
0) when called inside it, because it's not called while handling an
event. This means when switching apps or activating a window, the
timestamp passed to `activate_window` may be 0, which is the reason why
the altTab switcher is currently broken when using modifier-less
keybindings.

Fix that by using `meta_display_get_current_time_roundtrip`, which
always return a valid timestamp, instead of
`shell_global_get_current_time`.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/847

6 years agopageIndicators: Redesign and add position-based animation
Alexander Mikhaylenko [Thu, 21 Nov 2019 22:24:46 +0000 (03:24 +0500)]
pageIndicators: Redesign and add position-based animation

Remove setCurrentPage() function, introduce setCurrentPosition() instead,
which allows to have fractional positions.

Make inactive dots smaller, filled and partially transparent, as opposed to
larger and fully opaque active dot. Make dots smaller overall, remove
borders. Interpolate each dot between active and inactive state based on
scroll position.

Make it impossible to "uncheck" the active dot.

Thanks Florian Müllner for parts of the code.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1932

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/843

6 years agost/button: Notify :pressed changes
Florian Müllner [Fri, 22 Nov 2019 17:53:26 +0000 (18:53 +0100)]
st/button: Notify :pressed changes

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/846

6 years agocleanup: Use g_clear_handle_id() for g_source_remove()
Robert Mader [Fri, 22 Nov 2019 00:42:14 +0000 (01:42 +0100)]
cleanup: Use g_clear_handle_id() for g_source_remove()

It makes sure we do not forget to zero the id and lets us avoid
zero checks before. We use it for all new code, lets clean up the
existing code base.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/845

6 years agoswitcherPopup: Show immediately on second key press
Florian Müllner [Thu, 21 Nov 2019 22:40:02 +0000 (23:40 +0100)]
switcherPopup: Show immediately on second key press

We slightly delay showing the switcher popup to avoid flashing it
briefly in the common case of quickly switching back-and-forth
between two windows.

However some users perceive this delay as slowness. Address this by
showing the popup immediately when another key press is consumed
(that is, a key like Tab is pressed).

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1928

6 years agompris: Use a scope specific message instead of a global one
Jonas Dreßler [Sun, 17 Nov 2019 15:24:52 +0000 (16:24 +0100)]
mpris: Use a scope specific message instead of a global one

Since the mpris implementation of the notification tray supports showing
multiple notification (one for each player), it doesn't make sense to
have only one global property to store the message, since that only
allows referencing one message at a time.

Instead, handle the MediaMessages completely inside the scope of
`_addPlayer()`, this should allow showing more than one message again,
which broke with commit 4dc44304dff2974d3b026b5aa58e0d5c25d38216 [1].

[1] https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/791

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/833

6 years agomessageList: Don't include message actor in error message
Jonas Dreßler [Sun, 17 Nov 2019 13:35:42 +0000 (14:35 +0100)]
messageList: Don't include message actor in error message

Because the message actor could also be undefined or a already
deallocated ClutterActor, we sometimes fail to show the error message
and get an error from Gjs instead.

So make sure we always log the proper error message and just leave out
the actor.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/833

6 years agocleanup: Use g_clear_signal_handler() where possible
Robert Mader [Thu, 21 Nov 2019 22:00:53 +0000 (23:00 +0100)]
cleanup: Use g_clear_signal_handler() where possible

`g_clear_signal_handler()` is usually cleaner and saver than
`g_signal_handler_disconnect()`. We use it new code, lets also
adopt the existing one.

See also https://gitlab.gnome.org/GNOME/mutter/merge_requests/868
and https://gitlab.gnome.org/GNOME/mutter/merge_requests/940

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/842

6 years agoappIcon: Remove drag monitor on destroy
Georges Basile Stavracas Neto [Thu, 21 Nov 2019 21:50:11 +0000 (18:50 -0300)]
appIcon: Remove drag monitor on destroy

It may happen that the app icon is destroyed with a drag
monitor still around, in which case, a load of warnings
will be shown.

Make sure to remove any pending drag monitor on destroy.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/841

6 years agofolderView: Reset schemas before removing the folder
Georges Basile Stavracas Neto [Thu, 21 Nov 2019 21:45:12 +0000 (18:45 -0300)]
folderView: Reset schemas before removing the folder

When removing the last icon of a folder, FolderView first removes
the folder from org.gnome.desktop.app-folders.folder-children, then
proceeds to reset all its keys, which removes the relocatable schema.

That order of operations turns out to be problematic. Removing the
folder from 'folder-children' destroys the folder icon, which in turn
destroys the folder view, which throws a load of warnings in the
journal.

Fix that by removing the folder after resetting the schema keys. In
fact, what we're doing here is not using 'this' anymore.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/841

6 years agobaseAppView: Destroy icon when removing
Georges Basile Stavracas Neto [Thu, 21 Nov 2019 21:21:44 +0000 (18:21 -0300)]
baseAppView: Destroy icon when removing

We cannot rely on the garbage collector to do that in a timely
manner, so destroy it explicitly.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/841

6 years agoallView: Rename variable
Georges Basile Stavracas Neto [Thu, 21 Nov 2019 21:03:34 +0000 (18:03 -0300)]
allView: Rename variable

The variable that holds the list of application icons is
called 'newApps', but that technically was never true,
since we only create new app icons when necessary.

Rename it to 'appIcons'.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/841

6 years agoallView, frequentView: Only create icons when necessary
Georges Basile Stavracas Neto [Thu, 21 Nov 2019 20:57:17 +0000 (17:57 -0300)]
allView, frequentView: Only create icons when necessary

The views (AllView and FrequentView) build a list of all applications
they contain. BaseView then diffs between what's currently added, and
what needs to be added, and removed.

This approach has a problem though: creating an AppIcon or a FolderIcon
connects to various signals, and we confuse the garbage collector.

When building the list of applications, instead of always creating new
icons, try to use already existing icons first.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1610
Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1694

6 years agopolkitAgent: Fix spinner
Florian Müllner [Thu, 21 Nov 2019 21:01:21 +0000 (22:01 +0100)]
polkitAgent: Fix spinner

Commit 6af25b282c accidentally changed the case of the property.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/840

6 years agodateMenu: Skip weather forecast if not valid
Philip Chimento [Tue, 19 Nov 2019 21:31:57 +0000 (13:31 -0800)]
dateMenu: Skip weather forecast if not valid

GWeather.Info.get_value_update() may indicate that the forecast is not
valid, or it may return a timestamp of 0 to indicate the information has
never been updated. In both of these cases, skip creating a widget for
it, as the information will not be accurate.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/835

6 years agodateMenu: Format weather forecast times without AM/PM
Philip Chimento [Tue, 19 Nov 2019 21:15:34 +0000 (13:15 -0800)]
dateMenu: Format weather forecast times without AM/PM

If the clock is set to 12h, the AM/PM in the weather forecast times
should be clear from the context, because they are the immediately
following hours. This makes it less likely that the times will be
ellipsized (in which case the AM/PM wouldn't be shown anyway.)

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/835

6 years agoIncrease .calendar-today visibility
cunidev [Wed, 20 Nov 2019 07:13:36 +0000 (08:13 +0100)]
Increase .calendar-today visibility

Adds some needed contrast to the calendar widget current day, solving #1873.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/823

6 years agoappMenu: Hide stopped spinner actor
Joonas Henriksson [Mon, 18 Nov 2019 20:25:59 +0000 (22:25 +0200)]
appMenu: Hide stopped spinner actor

Get rid of leftover empty space from the application menu panel
button, that was used by the spinner actor, which remained visible
even after the spinner had stopped.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1679
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/832

6 years agoanimation: Add parameter for hiding stopped Spinner actor
Joonas Henriksson [Mon, 18 Nov 2019 20:24:05 +0000 (22:24 +0200)]
animation: Add parameter for hiding stopped Spinner actor

Not hiding leaves the empty actor space visible, which may have an
undesirable effect on the parent element's size or spacing/padding.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/832

6 years agoanimation: Turn Spinner animate parameter into Params option
Joonas Henriksson [Mon, 18 Nov 2019 20:18:29 +0000 (22:18 +0200)]
animation: Turn Spinner animate parameter into Params option

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/832

6 years agoUpdate Friulian translation
Fabio Tomat [Mon, 18 Nov 2019 08:56:08 +0000 (08:56 +0000)]
Update Friulian translation

6 years agokeyboard: Try harder to find a matching layout
Florian Müllner [Sat, 16 Nov 2019 12:48:35 +0000 (13:48 +0100)]
keyboard: Try harder to find a matching layout

While we support a reasonable list of layouts nowadays, we don't
include many variants like `fr+oss`. Instead of directly falling
back to the `us` layout, try stripping the variant first, as the
base layout is likely closer to the expectation than `us`.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1907

6 years agopolkitAgent: Cancel session after disconnecting signal handlers
Jonas Dreßler [Sun, 23 Jun 2019 11:11:58 +0000 (13:11 +0200)]
polkitAgent: Cancel session after disconnecting signal handlers

When cancelling the PolkitAgent session before disconnecting the signal
handlers, we receive a "completed" signal where `gained_authorization`
is set to FALSE, which means we show an error message inside
`_onSessionCompleted()`.

This in turn means we show an error message every time we cancel a
session. In practice this wasn't really relevant so far since we only
destroyed the session when an actual error occurred before. Now that the
dialog supports empty passwords, we also call `_destroySession()` when
the user changes and no longer has a password set, and in this case we
want to cancel the current session without showing an error message.

So to fix this, disconnect the signal handlers before cancelling the
session, which makes sure we don't receive the last "completed" signal
in case we cancelled the session ourselves. This change also allows
removing `this._wasDismissed`.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/829

6 years agopolkitAgent: Use dialog as confirmation when the user has no password
Joaquim Rocha [Sun, 23 Jun 2019 10:32:35 +0000 (12:32 +0200)]
polkitAgent: Use dialog as confirmation when the user has no password

When a user has no password and a polkit authentication is started,
instead of blindly initiating the admin session, show the regular
"Authentication Requested" dialog (but without the password entry). This
makes sure that the user's admin session is only effectively started
after the user chooses to proceed with the authentication, which
provides an extra confirmation step that can be vital for critical
tasks.

To do this, we show the dialog inside `_onUserChanged()` right after the
dialog was created instead of calling `performAuthentication()` from
`_onInitiate()`. The bug mentioned in `_onInitiate()` is no longer an
issue since we show the dialog in all cases now anyway.

Ideally we should use a different wording than "authentication" when the
user has no password set, and use "confirmation" instead. However polkit
already sends the requests with such messages (e.g. "Authentication is
required to configure software repositories"), and it's important to
show those to the user, so this patch keeps the regular wording.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/829

6 years agopolkitAgent: Only reset UI on session resets while opened
Jonas Dreßler [Thu, 14 Nov 2019 17:51:01 +0000 (18:51 +0100)]
polkitAgent: Only reset UI on session resets while opened

Since `_destroySession()` is not only called before we try to initiate a
new authentication session with Polkit, but also when the dialog is
closed, it's currently possible that key focus is grabbed by the close
button after the dialog was dismissed and hidden. This is causing a bug
where after dismissing one of multiple queued dialogs, key focus goes
away and keyboard navigation with the new dialog is impossible.

Fix this by only resetting the UI of the dialog if the dialog is still
opened/visible at that point.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/828

6 years agopanel: Don't chain up to non-existent parent vfunc
Jonas Dreßler [Mon, 4 Nov 2019 10:18:25 +0000 (11:18 +0100)]
panel: Don't chain up to non-existent parent vfunc

Just as with c35b4cede58142797b1f6b04a4e2e7eaa938234a, there's no
default vfunc implemented by any parent which causes gjs to crash when
trying to call it.

So return EVENT_STOP if the key press successfully toggled the button,
and EVENT_PROPAGATE otherwise.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/830

6 years agoStop referring to ClutterTexture
Jonas Ådahl [Tue, 12 Nov 2019 18:43:38 +0000 (19:43 +0100)]
Stop referring to ClutterTexture

ClutterTexture is removed from mutter's clutter fork, so lets stop
referring to it. This also happens to fix an incorrect type cast.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/822

6 years agobackground: Add exception to no-loop-func rule
Florian Müllner [Sun, 15 Sep 2019 00:51:40 +0000 (02:51 +0200)]
background: Add exception to no-loop-func rule

Modifying variables from an outer scope in functions created in a loop
is considered problematic by eslint, because the variable value in the
resulting closure is often not what the coder intended.

In this particular case however, the scoping is correct, so add a comment
to disable the rule locally.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/818

6 years agostyle: Allow lonely ifs where appropriate
Florian Müllner [Tue, 20 Aug 2019 02:24:37 +0000 (04:24 +0200)]
style: Allow lonely ifs where appropriate

We now have a lint rule to disallow lonely ifs, however there are
cases where the "lonely" part mirrors code from the preceding if
clause. Opt out of the lint rule in those cases.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/818

6 years agolint: Disable eqeqeq in legacy configuration
Florian Müllner [Tue, 20 Aug 2019 20:18:04 +0000 (22:18 +0200)]
lint: Disable eqeqeq in legacy configuration

Using type-safe comparisons is a good idea, but after not doing so
for a decade, there's too much existing code around for flipping
the switch right away.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/818

6 years agolint: Sync configuration with gjs
Florian Müllner [Mon, 19 Aug 2019 17:28:51 +0000 (19:28 +0200)]
lint: Sync configuration with gjs

gjs updates its configuration to a much more complete and
thorough set, follow suite.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/818

6 years agolint: Convert eslint JSON to YAML
Florian Müllner [Mon, 19 Aug 2019 17:20:55 +0000 (19:20 +0200)]
lint: Convert eslint JSON to YAML

gjs has changed its configuration to YAML, so switch to that format
to keep syncing possible.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/818

6 years agofolderView: Center folder icon
Georges Basile Stavracas Neto [Mon, 11 Nov 2019 21:07:19 +0000 (18:07 -0300)]
folderView: Center folder icon

The FolderView class is responsible for creating the 4-item
grid of the folder icon, with the preview of the first four
apps inside the folder.

However, with the deprecation of StAlign as child properties,
the folder icon stopped being horizontally centralized.

Center the folder icon horizontally again.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/817

6 years agocleanup: Use JSDoc for documentation comments
Florian Müllner [Thu, 17 Oct 2019 16:41:52 +0000 (18:41 +0200)]
cleanup: Use JSDoc for documentation comments

It's a better fit than gtk-doc, and eslint can validate that they
are complete and use correct syntax.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805

6 years agocleanup: Don't use gtk-doc syntax for regular comments
Florian Müllner [Thu, 17 Oct 2019 17:49:18 +0000 (19:49 +0200)]
cleanup: Don't use gtk-doc syntax for regular comments

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805

6 years agocleanup: Avoid unnecessary parentheses
Florian Müllner [Mon, 19 Aug 2019 19:38:51 +0000 (21:38 +0200)]
cleanup: Avoid unnecessary parentheses

Extra parentheses usually add noise rather than clarity, so avoid
them.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805

6 years agocleanup: Require "dangling" commas
Florian Müllner [Tue, 20 Aug 2019 21:43:54 +0000 (23:43 +0200)]
cleanup: Require "dangling" commas

Since ES5, trailing commas in arrays and object literals are valid.
We generally haven't used them so far, but they are actually a good
idea, as they make additions and removals in diffs much cleaner.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805

6 years agocleanup: Only omit braces for single-line blocks
Florian Müllner [Tue, 20 Aug 2019 00:51:42 +0000 (02:51 +0200)]
cleanup: Only omit braces for single-line blocks

Braces can be avoided when a block consists of a single statement,
but readability suffers when the statement spans more than a single
line.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805

6 years agocleanup: Use object shorthand where possible
Florian Müllner [Mon, 19 Aug 2019 19:06:04 +0000 (21:06 +0200)]
cleanup: Use object shorthand where possible

ES6 allows to omit property names where they match the name of the
assigned variable, which makes code less redunant and thus cleaner.
We will soon enforce that in our eslint rules, so make sure we use
the shorthand wherever possible.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805

6 years agocleanup: Fix missing/stray spaces
Florian Müllner [Mon, 19 Aug 2019 17:55:49 +0000 (19:55 +0200)]
cleanup: Fix missing/stray spaces

Those are wrong according to our style guidelines, but the previous
eslint ruleset didn't catch them.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805

6 years agocleanup: Don't shadow variables
Florian Müllner [Tue, 20 Aug 2019 00:20:08 +0000 (02:20 +0200)]
cleanup: Don't shadow variables

Having variables that share the same name in overlapping scopes is
confusing and error-prone, and is best avoided.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805

6 years agocleanup: Avoid "lonely" ifs where it makes sense
Florian Müllner [Tue, 20 Aug 2019 02:10:46 +0000 (04:10 +0200)]
cleanup: Avoid "lonely" ifs where it makes sense

If an else block only contains an if statement, the two can be
combined into an if-else block, which cuts down on indentation
and usually helps legibility.

There are exceptions (for instance where the outer if and else
blocks are mirrored), but where it makes sense, change the code
to avoid lonely ifs.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805

6 years agocleanup: Avoid unnecessary braces
Florian Müllner [Tue, 20 Aug 2019 00:51:42 +0000 (02:51 +0200)]
cleanup: Avoid unnecessary braces

Our coding style has always been to avoid braces when all blocks
are single-lines.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805

6 years agoctrlAltTab: Use arrow function for callback
Florian Müllner [Mon, 11 Nov 2019 14:01:00 +0000 (15:01 +0100)]
ctrlAltTab: Use arrow function for callback

This was left over because we are binding a different `this`, but
it is easy enough to replace.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805

6 years agojsParse: Unnest functions
Florian Müllner [Tue, 20 Aug 2019 00:24:28 +0000 (02:24 +0200)]
jsParse: Unnest functions

Nesting functions can be helpful for private helper functions, but
here they are accessing some variables from the outer scope and
shadowing others. Split them out to avoid any ambiguity.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805

6 years agoallView: Ensure event blocker is reactive before popup is open
Georges Basile Stavracas Neto [Mon, 11 Nov 2019 16:10:53 +0000 (13:10 -0300)]
allView: Ensure event blocker is reactive before popup is open

The event blocker in AllView is responsible for stealing click events
from the icon grid and closing the folder popup. The event blocker is
kept unreactive when no folder popup is visible, and it's made reactive
as a response to the 'open-state-changed' signal.

Using this signal, though, is problematic. When opening an app folder,
the icon grid first opens space for the folder to fit in; during this
period, it's possible to click on another folder icon, and break the
icon grid state.

Make sure the event blocker is reactive immediately after clicking on
a folder icon.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1470

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/816

6 years agojs: Fix alignment
Florian Müllner [Wed, 6 Nov 2019 11:05:56 +0000 (12:05 +0100)]
js: Fix alignment

The old StBin alignment properties defaulted to MIDDLE, while the
ClutterActor properties use FILL. Fix the resulting fallout by
setting the alignment explicitly where necessary.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/809

6 years agoUpdate Indonesian translation
Andika Triwidada [Sun, 10 Nov 2019 02:35:26 +0000 (02:35 +0000)]
Update Indonesian translation

7 years agostyle: Don't specify font-family
Florian Müllner [Mon, 8 Apr 2019 15:52:33 +0000 (17:52 +0200)]
style: Don't specify font-family

Now that the default font follows the interface setting, stop
overriding it in the CSS.

https://bugzilla.gnome.org/show_bug.cgi?id=688288

7 years agotheme-context: Use interface font instead of hardcoded default
Florian Müllner [Mon, 8 Apr 2019 15:50:08 +0000 (17:50 +0200)]
theme-context: Use interface font instead of hardcoded default

With this, gnome-shell will now follow the interface setting instead
of hardcoding a default font, unless when overwritten by the CSS.

https://bugzilla.gnome.org/show_bug.cgi?id=688288

7 years agost: Add Settings:font-name property
Florian Müllner [Mon, 8 Apr 2019 15:35:06 +0000 (17:35 +0200)]
st: Add Settings:font-name property

This maps to the corresponding interface setting and will be used to
replace the hard-coded font in the CSS.

https://bugzilla.gnome.org/show_bug.cgi?id=688288

7 years agost: Fix a minor leak
Florian Müllner [Sat, 11 May 2019 08:18:00 +0000 (08:18 +0000)]
st: Fix a minor leak

StSetting is used as a singleton, so this leak does not matter in
practise.

Spotted by Jonas Dreßler.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/486

7 years agocalendar: Define EventSourceBase and extend EventSource's
Marco Trevisan (Treviño) [Wed, 29 May 2019 05:52:17 +0000 (07:52 +0200)]
calendar: Define EventSourceBase and extend EventSource's

Objects implementing EventSource should have some mandatory methods and
properties, we can ensure this by defining an EventSourceBase abstract
class.

So inherit EmptyEventSource and DBusEventSource from it making sure that
they implement all the needed methods, using native properties and
replacing the 'notify::*' fake signal emissions with proper object
notifications.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/563

7 years agomodemManager: Define ModemBase GObject class for modems
Marco Trevisan (Treviño) [Wed, 29 May 2019 02:25:57 +0000 (04:25 +0200)]
modemManager: Define ModemBase GObject class for modems

Use GObject based objects for ModemGsm, ModemCdma and BroadbandModem.
This allows to define a base class that we can use to natively define
properties and notify property changes.

We can now remove the "fake" notify signals with proper properties
notifications.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/563

7 years agobackground: Inherit Animation from GnomeDesktop.BGSlideShow
Marco Trevisan (Treviño) [Tue, 28 May 2019 23:21:51 +0000 (01:21 +0200)]
background: Inherit Animation from GnomeDesktop.BGSlideShow

Animation background is just wrapping a native GnomeDesktop BGSlideShow
object, so instead of using composition we can now just inherit from the
native GObject, re-using native properties when possible, and avoiding
to keep an extra wrapper to the bg file.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/563

7 years agokeyring: Inherit KeyringPrompter from Gcr.SystemPrompter
Marco Trevisan (Treviño) [Tue, 28 May 2019 21:07:51 +0000 (23:07 +0200)]
keyring: Inherit KeyringPrompter from Gcr.SystemPrompter

Keyring is just a simple wrapper to a Gcr.SystemPrompter object, so use
inheritance instead.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/563

7 years agopolkitAgent: Inherit AuthenticationAgent from Shell.PolkitAuthenticationAgent
Marco Trevisan (Treviño) [Tue, 28 May 2019 20:58:35 +0000 (22:58 +0200)]
polkitAgent: Inherit AuthenticationAgent from Shell.PolkitAuthenticationAgent

AuthenticationAgent is just a wrapper of Shell's PolkitAuthenticationAgent, so
instead of using composition we can simply extend the base GObject.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/563

7 years agowindowManager: Complete interrupted size change effects
Florian Müllner [Fri, 8 Nov 2019 17:22:40 +0000 (18:22 +0100)]
windowManager: Complete interrupted size change effects

Resizing effects are more finicky as other effects, as the actual
animation is delayed until we receive the ::size-changed signal.

However that signal may never be emitted if the window is destroyed
just after starting the size-change effect, in which case the effect
is never completed, blocking mutter from destroying the corresponding
window actor.

Address this by tracking when a resize effect is pending, and complete
the effect when appropriate.

https://gitlab.gnome.org/GNOME/mutter/issues/655
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/815

7 years agowindowManager: Use Sets to track ongoing effects
Florian Müllner [Fri, 8 Nov 2019 17:00:05 +0000 (18:00 +0100)]
windowManager: Use Sets to track ongoing effects

We only care whether an effect is ongoing for an actor, not about
any particular order. Sets are more convenient than arrays in that
case, so use them instead.

https://gitlab.gnome.org/GNOME/mutter/issues/655
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/815

7 years agoinputMethod: Compare ibus context before processing key event result
Carlos Garnacho [Thu, 7 Nov 2019 18:06:15 +0000 (19:06 +0100)]
inputMethod: Compare ibus context before processing key event result

In the xwayland-on-demand scenario, it may happen that Xwayland is
shutdown (causing a restart of ibus-daemon to drop ibus-x11) while
we are typing.

If we have a bit of bad luck, this will cause the IBusInputContext
to be disposed (due to its bus "closing") at a time when we have
an ibus_input_context_process_key_event_async() request on the fly.

As the object is disposed in between this would tickle JS (rightfully
complaining that it's been disposed under its feet) and make us pass
an actually NULL IBusInputContext to the corresponding _finish()
function (despite the IBusInputContext being still held alive by some
other refs). This will assert and abort in
ibus_input_context_process_key_event_async_finish() then.

To handle this, listen for IBusInputContext::destroy, and reset our
internal state, this way we can compare on the JS side that the
IBusInputContext is indeed an up-to-date one.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/813

7 years agopower: Handle "100% but charging" case
Philip Chimento [Thu, 7 Nov 2019 20:51:28 +0000 (12:51 -0800)]
power: Handle "100% but charging" case

I've observed that UPower can occasionally report a charge level of 100%
while the state is still "charging". This usually doesn't last very long
but it is noticeable because the power icon changes to a "missing icon"
icon. This will handle that rare case correctly.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/814

7 years agoci: Fix checking out mutter on stable branches
Florian Müllner [Wed, 6 Nov 2019 19:54:57 +0000 (20:54 +0100)]
ci: Fix checking out mutter on stable branches

For stable branches, we currently only check out the correct mutter
branch for merge requests. For the regular pipeline, our code to
determine the current shell branch fails because CI runs on a
temporary "pipeline/12345" branch that doesn't exist for mutter.

Switching to the correct gitlab environment variable fixes that.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/811

7 years agoscreenshot: Allow saving to clipboard
Carlos Garnacho [Tue, 5 Nov 2019 23:48:25 +0000 (00:48 +0100)]
screenshot: Allow saving to clipboard

If no target file is specified (i.e. filename is an empty string), the
screenshot will be stored on the clipboard instead.

https://gitlab.gnome.org/GNOME/mutter/issues/789
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/810

7 years agoshell: Make screenshot API stream based
Carlos Garnacho [Tue, 5 Nov 2019 23:46:41 +0000 (00:46 +0100)]
shell: Make screenshot API stream based

Instead of dealing with filenames, make the low-level API use streams
so the target remains generic.

This so far means JS code now determines the appropriate filename to
use for storing the screenshot, but will be used in other ways in
future commits.

https://gitlab.gnome.org/GNOME/mutter/issues/789
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/810

7 years agost: Add StClipboard method to set arbitrary clipboard content
Carlos Garnacho [Tue, 5 Nov 2019 23:40:17 +0000 (00:40 +0100)]
st: Add StClipboard method to set arbitrary clipboard content

This complements the current text-based API.

https://gitlab.gnome.org/GNOME/mutter/issues/789
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/810

7 years agoshell: Remove format_date() utility function
Florian Müllner [Tue, 10 Sep 2019 03:12:14 +0000 (05:12 +0200)]
shell: Remove format_date() utility function

It is now unused.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/807

7 years agoenvironment: Reimplement Date.toLocaleFormat() override
Florian Müllner [Tue, 10 Sep 2019 03:10:01 +0000 (05:10 +0200)]
environment: Reimplement Date.toLocaleFormat() override

Now that we no longer go through GTimeVal to convert from Date to
GDateTime, there is no more reason for using a C helper function.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/807

7 years agoenvironment: Stop adding child_set() to layout managers
Florian Müllner [Tue, 5 Nov 2019 23:08:04 +0000 (00:08 +0100)]
environment: Stop adding child_set() to layout managers

We no longer use any layout managers that use custom child properties
instead of the generic Clutter.Actor properties, so this override
is completely unused.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/808

7 years agoenvironment: Stop monkey-patching Clutter.TableLayout
Florian Müllner [Tue, 5 Nov 2019 23:05:38 +0000 (00:05 +0100)]
environment: Stop monkey-patching Clutter.TableLayout

It's not used for anything anymore, and may well end up being removed.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/808

7 years agocleanup: Use non-deprecated key symbols
Florian Müllner [Tue, 5 Nov 2019 19:37:28 +0000 (20:37 +0100)]
cleanup: Use non-deprecated key symbols

Clutter originally cluttered its namespace with key symbols, before
prefixing all symbols with KEY. We still use the unprefixed symbols
occasionally, replace them so mutter can drop the deprecated symbols.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/808

7 years agocleanup: Replace deprecated lower/raise calls
Florian Müllner [Tue, 5 Nov 2019 19:17:19 +0000 (20:17 +0100)]
cleanup: Replace deprecated lower/raise calls

Those methods have been deprecated for a long time, so
move to the drop-in replacement.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/808

7 years agowindowManager: Stop using Clutter.Actor.prototype.reparent()
Florian Müllner [Tue, 5 Nov 2019 18:35:41 +0000 (19:35 +0100)]
windowManager: Stop using Clutter.Actor.prototype.reparent()

It has been deprecated for ages, and is about to be dropped from mutter.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/808

7 years agocalendar: Use Clutter.GridLayout
Florian Müllner [Fri, 20 Jun 2014 14:23:32 +0000 (16:23 +0200)]
calendar: Use Clutter.GridLayout

Clutter.TableLayout has been deprecated, so move to the recommended
replacement.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/808

7 years agopolkitAgent: Use a timeout for resetting the dialog
Jonas Dreßler [Sun, 23 Jun 2019 14:32:29 +0000 (16:32 +0200)]
polkitAgent: Use a timeout for resetting the dialog

Since polkit takes a few milliseconds from initiating the session to
emitting the "request" signal, don't introduce visual distraction by
hiding the password entry and showing it again a few ms later.

So start a timeout of 200 ms when we destroy a session and if no session
request (i.e. a request for a password-authentication) happened during
this timeout, hide the password entry.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/788

7 years agopolkitAgent: Reset dialog to defaults after cancelling polkit session
Jonas Dreßler [Sun, 23 Jun 2019 14:33:20 +0000 (16:33 +0200)]
polkitAgent: Reset dialog to defaults after cancelling polkit session

Since we don't know if polkit/PAM will request a password (emitting the
"request" signal) or use another authentication method like a
fingerprint after the current authentication failed, hide the password
field and make the "Authenticate" button insensitive after cancelling
the session, just like we do when creating the dialog.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/788

7 years agopolkitAgent: Make authenticate button insensitive if password is empty
Jonas Dreßler [Mon, 24 Jun 2019 10:36:47 +0000 (12:36 +0200)]
polkitAgent: Make authenticate button insensitive if password is empty

According to the mockups, make the polkit dialogs "Authenticate" button
insensitive and don't respond to pressing the enter key if no password
is supplied.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/788

7 years agopolkitAgent: Only set key focus to password entry after opening dialog
Jonas Dreßler [Mon, 24 Jun 2019 08:57:24 +0000 (10:57 +0200)]
polkitAgent: Only set key focus to password entry after opening dialog

Set the key focus to the password field only after we got a request
(and therefore know that a password is requested) instead of using
`setInitialKeyFocus()`. This way we don't try to focus the password
field by default if we aren't showing it (e.g. in case the user has no
password or is using fingerprint login).

Also we have to move the call to `grab_key_focus()` to happen after
`_ensureOpen()`, because otherwise the ModalDialog will set the focus to
one of the buttons while opening itself.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/788

7 years agopolkitAgent: Also show user avatar for root user
Jonas Dreßler [Sun, 23 Jun 2019 10:15:12 +0000 (12:15 +0200)]
polkitAgent: Also show user avatar for root user

Show the user avatar for all users, including the root user. The root
user will always have the generic avatar, but it looks more consistent
than showing no avatar at all.

This way we also don't have to worry about the spacing introduced by the
polkit-dialog-user-layout CSS class, which would give the
"Administrator" label a small offset to the left.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/788

7 years agopolkitAgent: Update user name on user changes
Jonas Dreßler [Sun, 23 Jun 2019 09:52:54 +0000 (11:52 +0200)]
polkitAgent: Update user name on user changes

Right now we only update the user avatar on the user-changed signal, but
since we also display the users real name we should also update that if
the user changes.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/788

7 years agopolkitAgent: Fix a typo of a signal name
Jonas Dreßler [Sun, 23 Jun 2019 09:40:42 +0000 (11:40 +0200)]
polkitAgent: Fix a typo of a signal name

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/788

7 years agoUpdated Spanish translation
Daniel Mustieles [Tue, 5 Nov 2019 14:38:42 +0000 (15:38 +0100)]
Updated Spanish translation

7 years agosystem: Replace action icons with regular menu items
Florian Müllner [Tue, 15 Oct 2019 18:51:33 +0000 (20:51 +0200)]
system: Replace action icons with regular menu items

Besides making the menu a bit less special, it allows us to fit both
shutdown and suspend actions without any hidden alt-key Easter eggs.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/270

7 years agoaltTab: Use correct actor in label height computation
Florian Müllner [Tue, 5 Nov 2019 01:36:38 +0000 (02:36 +0100)]
altTab: Use correct actor in label height computation

Commit f2bd39b20 removed an intermediate bin, and now we use the
thumbnail bin instead of the label actor to compute the label
height, whoops.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/804

7 years agost: Track stylesheet changes on the StThemeContext
Carlos Garnacho [Thu, 24 Oct 2019 12:03:12 +0000 (14:03 +0200)]
st: Track stylesheet changes on the StThemeContext

Instead of every individual StThemeNode. There are essentially two kinds
of theme nodes: Those we create for lookups, and those interned by the
theme context and used by StWidgets. Listening to the signal on the former
is pointless as they are short lived and not meant to be really used for
drawing. So it is only essential to track stylesheet changes in those we
intern for later use.

This change does precisely that, it lets the StThemeContext track the
stylesheet changes and let all known theme nodes reset their state for
it.

The internal array holding all connected handlers for this signal in glib
was about the biggest single allocation made in gnome-shell, as interned
theme nodes nodes are around the 4 to 5 digit numbers. This essentially
makes it disappear.

This however means that widgets that are explicitly set a theme through
st_widget_set_theme() don't get their theme node implicitly updated.
There's little reasons to use that API, so perhaps this is an acceptable
tradeoff.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/779